import request from '@/util/axios';
import website from '@/config/website';

export const getCaptcha = () => {
	return request({
		url: 'blade-auth/captcha',
		method: 'get'
	});
}

export const loginSys = (tenantId, account, password, type, key, code) => {
	return request({
		url: 'blade-auth/token',
		method: 'post',
		headers: {
			'Captcha-Key': key,
			'Captcha-Code': code,
		},
		params: {
			grantType: (website.captchaMode ? "captcha" : "password"),
			tenantId,
			account,
			password,
			type
		}
	});
}